const express = require("express");
const router = express.Router();
const Response = require("../utils/Response.js");
// 引入mysql连接池
const pool = require("../utils/db.js");

router.get("/commynity/items", (req, resp)=>{
    let obj = req.query;
    let sql = "select * from hot where hot_id=?"
    pool.query(sql,[obj.hot_id], (error, result)=>{
      if (error) {
        resp.send(Response.error(500, error));
        throw error;
      }
      // 查询成功 返回标签
      resp.send(Response.ok({result}));
    })
  });

  // 将router对象导出
module.exports = router;